\(\int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx\) [555]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 116 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {4 a \left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^5 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{b^4 d}-\frac {a \tan ^2(c+d x)}{b^3 d}+\frac {\tan ^3(c+d x)}{3 b^2 d}-\frac {\left (a^2+b^2\right )^2}{b^5 d (a+b \tan (c+d x))} \]

[Out]

-4*a*(a^2+b^2)*ln(a+b*tan(d*x+c))/b^5/d+(3*a^2+2*b^2)*tan(d*x+c)/b^4/d-a*tan(d*x+c)^2/b^3/d+1/3*tan(d*x+c)^3/b
^2/d-(a^2+b^2)^2/b^5/d/(a+b*tan(d*x+c))

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3587, 711} \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\left (a^2+b^2\right )^2}{b^5 d (a+b \tan (c+d x))}-\frac {4 a \left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^5 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{b^4 d}-\frac {a \tan ^2(c+d x)}{b^3 d}+\frac {\tan ^3(c+d x)}{3 b^2 d} \]

[In]

Int[Sec[c + d*x]^6/(a + b*Tan[c + d*x])^2,x]

[Out]

(-4*a*(a^2 + b^2)*Log[a + b*Tan[c + d*x]])/(b^5*d) + ((3*a^2 + 2*b^2)*Tan[c + d*x])/(b^4*d) - (a*Tan[c + d*x]^
2)/(b^3*d) + Tan[c + d*x]^3/(3*b^2*d) - (a^2 + b^2)^2/(b^5*d*(a + b*Tan[c + d*x]))

Rule 711

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*(a + c*
x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[p, 0]

Rule 3587

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (1+\frac {x^2}{b^2}\right )^2}{(a+x)^2} \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {3 a^2+2 b^2}{b^4}-\frac {2 a x}{b^4}+\frac {x^2}{b^4}+\frac {\left (a^2+b^2\right )^2}{b^4 (a+x)^2}-\frac {4 a \left (a^2+b^2\right )}{b^4 (a+x)}\right ) \, dx,x,b \tan (c+d x)\right )}{b d} \\ & = -\frac {4 a \left (a^2+b^2\right ) \log (a+b \tan (c+d x))}{b^5 d}+\frac {\left (3 a^2+2 b^2\right ) \tan (c+d x)}{b^4 d}-\frac {a \tan ^2(c+d x)}{b^3 d}+\frac {\tan ^3(c+d x)}{3 b^2 d}-\frac {\left (a^2+b^2\right )^2}{b^5 d (a+b \tan (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 5.39 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.05 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {4 b \left (2 a^2+b^2\right ) \tan (c+d x)-2 a b^2 \tan ^2(c+d x)+\frac {b^4 \sec ^4(c+d x)-4 \left (a^2+b^2\right ) \left (a^2+b^2+3 a^2 \log (a+b \tan (c+d x))+3 a b \log (a+b \tan (c+d x)) \tan (c+d x)\right )}{a+b \tan (c+d x)}}{3 b^5 d} \]

[In]

Integrate[Sec[c + d*x]^6/(a + b*Tan[c + d*x])^2,x]

[Out]

(4*b*(2*a^2 + b^2)*Tan[c + d*x] - 2*a*b^2*Tan[c + d*x]^2 + (b^4*Sec[c + d*x]^4 - 4*(a^2 + b^2)*(a^2 + b^2 + 3*
a^2*Log[a + b*Tan[c + d*x]] + 3*a*b*Log[a + b*Tan[c + d*x]]*Tan[c + d*x]))/(a + b*Tan[c + d*x]))/(3*b^5*d)

Maple [A] (verified)

Time = 58.77 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.98

method result size
derivativedivides \(\frac {\frac {\frac {b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{3}-a b \left (\tan ^{2}\left (d x +c \right )\right )+3 a^{2} \tan \left (d x +c \right )+2 b^{2} \tan \left (d x +c \right )}{b^{4}}-\frac {a^{4}+2 a^{2} b^{2}+b^{4}}{b^{5} \left (a +b \tan \left (d x +c \right )\right )}-\frac {4 a \left (a^{2}+b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5}}}{d}\) \(114\)
default \(\frac {\frac {\frac {b^{2} \left (\tan ^{3}\left (d x +c \right )\right )}{3}-a b \left (\tan ^{2}\left (d x +c \right )\right )+3 a^{2} \tan \left (d x +c \right )+2 b^{2} \tan \left (d x +c \right )}{b^{4}}-\frac {a^{4}+2 a^{2} b^{2}+b^{4}}{b^{5} \left (a +b \tan \left (d x +c \right )\right )}-\frac {4 a \left (a^{2}+b^{2}\right ) \ln \left (a +b \tan \left (d x +c \right )\right )}{b^{5}}}{d}\) \(114\)
risch \(-\frac {8 i \left (3 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}-3 i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}-9 i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}-9 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}+2 b^{3}+3 a^{2} b -2 i a \,b^{2}-3 i a^{3}+4 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-3 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}-6 i a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-5 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{3 \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+i a \,{\mathrm e}^{2 i \left (d x +c \right )}-b +i a \right ) b^{4} d}+\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{5} d}+\frac {4 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{3} d}-\frac {4 a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{5} d}-\frac {4 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {i b +a}{i b -a}\right )}{b^{3} d}\) \(342\)

[In]

int(sec(d*x+c)^6/(a+b*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/b^4*(1/3*b^2*tan(d*x+c)^3-a*b*tan(d*x+c)^2+3*a^2*tan(d*x+c)+2*b^2*tan(d*x+c))-1/b^5*(a^4+2*a^2*b^2+b^4)
/(a+b*tan(d*x+c))-4*a/b^5*(a^2+b^2)*ln(a+b*tan(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 281 vs. \(2 (114) = 228\).

Time = 0.27 (sec) , antiderivative size = 281, normalized size of antiderivative = 2.42 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {4 \, {\left (3 \, a^{2} b^{2} + 2 \, b^{4}\right )} \cos \left (d x + c\right )^{4} - b^{4} - 2 \, {\left (3 \, a^{2} b^{2} + 2 \, b^{4}\right )} \cos \left (d x + c\right )^{2} + 6 \, {\left ({\left (a^{4} + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{4} + {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )\right )} \log \left (2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}\right ) - 6 \, {\left ({\left (a^{4} + a^{2} b^{2}\right )} \cos \left (d x + c\right )^{4} + {\left (a^{3} b + a b^{3}\right )} \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )\right )} \log \left (\cos \left (d x + c\right )^{2}\right ) + 2 \, {\left (a b^{3} \cos \left (d x + c\right ) - 2 \, {\left (3 \, a^{3} b + 2 \, a b^{3}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{3 \, {\left (a b^{5} d \cos \left (d x + c\right )^{4} + b^{6} d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )\right )}} \]

[In]

integrate(sec(d*x+c)^6/(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/3*(4*(3*a^2*b^2 + 2*b^4)*cos(d*x + c)^4 - b^4 - 2*(3*a^2*b^2 + 2*b^4)*cos(d*x + c)^2 + 6*((a^4 + a^2*b^2)*c
os(d*x + c)^4 + (a^3*b + a*b^3)*cos(d*x + c)^3*sin(d*x + c))*log(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)
*cos(d*x + c)^2 + b^2) - 6*((a^4 + a^2*b^2)*cos(d*x + c)^4 + (a^3*b + a*b^3)*cos(d*x + c)^3*sin(d*x + c))*log(
cos(d*x + c)^2) + 2*(a*b^3*cos(d*x + c) - 2*(3*a^3*b + 2*a*b^3)*cos(d*x + c)^3)*sin(d*x + c))/(a*b^5*d*cos(d*x
 + c)^4 + b^6*d*cos(d*x + c)^3*sin(d*x + c))

Sympy [F]

\[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\int \frac {\sec ^{6}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \]

[In]

integrate(sec(d*x+c)**6/(a+b*tan(d*x+c))**2,x)

[Out]

Integral(sec(c + d*x)**6/(a + b*tan(c + d*x))**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 115, normalized size of antiderivative = 0.99 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )}}{b^{6} \tan \left (d x + c\right ) + a b^{5}} - \frac {b^{2} \tan \left (d x + c\right )^{3} - 3 \, a b \tan \left (d x + c\right )^{2} + 3 \, {\left (3 \, a^{2} + 2 \, b^{2}\right )} \tan \left (d x + c\right )}{b^{4}} + \frac {12 \, {\left (a^{3} + a b^{2}\right )} \log \left (b \tan \left (d x + c\right ) + a\right )}{b^{5}}}{3 \, d} \]

[In]

integrate(sec(d*x+c)^6/(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/3*(3*(a^4 + 2*a^2*b^2 + b^4)/(b^6*tan(d*x + c) + a*b^5) - (b^2*tan(d*x + c)^3 - 3*a*b*tan(d*x + c)^2 + 3*(3
*a^2 + 2*b^2)*tan(d*x + c))/b^4 + 12*(a^3 + a*b^2)*log(b*tan(d*x + c) + a)/b^5)/d

Giac [A] (verification not implemented)

none

Time = 0.45 (sec) , antiderivative size = 149, normalized size of antiderivative = 1.28 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {12 \, {\left (a^{3} + a b^{2}\right )} \log \left ({\left | b \tan \left (d x + c\right ) + a \right |}\right )}{b^{5}} - \frac {b^{4} \tan \left (d x + c\right )^{3} - 3 \, a b^{3} \tan \left (d x + c\right )^{2} + 9 \, a^{2} b^{2} \tan \left (d x + c\right ) + 6 \, b^{4} \tan \left (d x + c\right )}{b^{6}} - \frac {3 \, {\left (4 \, a^{3} b \tan \left (d x + c\right ) + 4 \, a b^{3} \tan \left (d x + c\right ) + 3 \, a^{4} + 2 \, a^{2} b^{2} - b^{4}\right )}}{{\left (b \tan \left (d x + c\right ) + a\right )} b^{5}}}{3 \, d} \]

[In]

integrate(sec(d*x+c)^6/(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

-1/3*(12*(a^3 + a*b^2)*log(abs(b*tan(d*x + c) + a))/b^5 - (b^4*tan(d*x + c)^3 - 3*a*b^3*tan(d*x + c)^2 + 9*a^2
*b^2*tan(d*x + c) + 6*b^4*tan(d*x + c))/b^6 - 3*(4*a^3*b*tan(d*x + c) + 4*a*b^3*tan(d*x + c) + 3*a^4 + 2*a^2*b
^2 - b^4)/((b*tan(d*x + c) + a)*b^5))/d

Mupad [B] (verification not implemented)

Time = 4.29 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.12 \[ \int \frac {\sec ^6(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,b^2\,d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (\frac {2}{b^2}+\frac {3\,a^2}{b^4}\right )}{d}-\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^2}{b^3\,d}-\frac {\ln \left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )\,\left (4\,a^3+4\,a\,b^2\right )}{b^5\,d}-\frac {a^4+2\,a^2\,b^2+b^4}{b\,d\,\left (\mathrm {tan}\left (c+d\,x\right )\,b^5+a\,b^4\right )} \]

[In]

int(1/(cos(c + d*x)^6*(a + b*tan(c + d*x))^2),x)

[Out]

tan(c + d*x)^3/(3*b^2*d) + (tan(c + d*x)*(2/b^2 + (3*a^2)/b^4))/d - (a*tan(c + d*x)^2)/(b^3*d) - (log(a + b*ta
n(c + d*x))*(4*a*b^2 + 4*a^3))/(b^5*d) - (a^4 + b^4 + 2*a^2*b^2)/(b*d*(a*b^4 + b^5*tan(c + d*x)))